<!--
 * @Author: Dorange.Wang
 * @Date: 2021-03-31 16:04:51
 * @LastEditors: wangming
 * @LastEditTime: 2022-08-03 10:30:50
 * @Description: file content
-->
<template>
  <el-dialog
    v-dialogDrag="dialogDrag"
    :close-on-click-modal="closeOnModal"
    :close-on-press-escape="false"
    :visible="visible"
    center
    :show-close="false"
    :width="width"
    :fullscreen="fullscreen"
    @close="close"
  >
    <div class="b g3 f16 tl" slot="title">
      <div class="ks-row pl10 pr10">
        <span>{{ name }}</span>
        <div class="ks-col tr">
          <Fullscreen class="mr10" @fullChange="(v) => (fullscreen = v)" />
        </div>
        <span
          class="el-icon-close g9 f20 poi"
          @click="$emit('closeModel')"
        ></span>
      </div>
    </div>
    <div class="pl10 pr10">
      <slot></slot>
    </div>
  </el-dialog>
</template>
<script>
export default {
  data() {
    return {
      fullscreen: false,
    };
  },
  methods: {
    close() {
      if (this.visible) {
        this.$emit("closeModel");
      }
      this.$emit("update:visible", false);
    },
  },
  props: ["visible", "width", "name", "closeOnModal", "dialogDrag"],
};
</script>

<style lang="scss" scoped>
::v-deep .el-dialog__body {
  padding: 10px 0 !important;
}
</style>
